package com.icinfo.cloud.provider.punish.execute.enums;

/**
 * @author
 * 裁执分离状态枚举
 */
public enum ExecuteStatusEnum {

    TO_DISPATCH("1","待指派"),

    HANDLING_EXECUTE("2","执行中"),

    END_EXECUTE("3","已完结");


    private String index;
    private String name;

    ExecuteStatusEnum(String index, String name) {
        this.index = index;
        this.name = name;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    /**
     * 描述：通过枚举值获取对应枚举对象
     *
     * @param index 枚举值
     * @return 枚举对象
     * @author zhangqiang
     */
    public static ExecuteStatusEnum getUserTypeDict(String index) {
        for (ExecuteStatusEnum dictEnum : ExecuteStatusEnum.values()) {
            if (dictEnum.getIndex().equals(index)) {
                return dictEnum;
            }
        }
        return null;
    }

    /**
     * 描述：通过枚举值获取枚举名称
     *
     * @param index 枚举值
     * @return 枚举名称
     * @author zhangqiang
     */
    public static String getValue(String index) {
        for (ExecuteStatusEnum dictEnum : ExecuteStatusEnum.values()) {
            if (dictEnum.getIndex().equals(index)) {
                return dictEnum.getName();
            }
        }
        return null;
    }
}
